﻿@{
    Layout = null;//分部视图如果你用标准的PartialView去渲染视图，这行会自动加上的
}
<ul class="header_r_ul" style="color: #fff; padding-top: 0px;">
    @if (string.IsNullOrWhiteSpace(VCommons.Http.CookieHelper.Read("eee114", "UserID"))
                 || Convert.ToInt32(VCommons.Http.CookieHelper.Read("eee114", "UserID")) <= 0)
    {
        using (Html.BeginForm())
        { 
     
    
        <li>账号：@Html.TextBox("Name", null, new { style = "width:50px;" })
            密码：@Html.TextBox("Password", null, new { style = "width:50px;" })
            <input type="button" value="登陆" id="Logon" /></li>
   
        }
    }
    else
    {
        <li><b>欢迎您：@VCommons.Http.CookieHelper.Read("eee114", "UserID")</b><a href="javascript:void(0)" onclick="logoutFun()">[登出]</a></li> 
    }
</ul>
<script type="text/javascript">
    $("#Logon").click(function () {
        //异步提交
        $.ajax({
            type: "Post",
            url: "/common/PartialLogon",
            data: $("form").serialize(),
            success: function (data) {
                alert(data.info);
                location.href = data.href;
            }
        });
    });

    function logoutFun() {
        $.ajax({
            type: "Post",
            url: "/common/PartialLogOut",
            success: function (data) {
                alert(data.info);
                location.href = data.href;
            }
        });
    }
</script>
